class DadoPessoal < ActiveRecord::Base
  belongs_to :funcionario, :dependent => :destroy

  #validates :funcionario_id, :presence => true
  validates :nome, :presence => true, :format => {:with => /\A[a-zA-Z]+\z/}
  validates :cpf, :uniqueness => true, :presence => true, :numericality => {:only_integer => true}, :length => {:is => 11}
  validates :email, :presence => true, :format => {:with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i}
  validates :horas_semanais, :presence => true, :numericality => true

end
